/** 
 * Project Name:jd-orm 
 * File Name:ISingerDatasourceFace.java 
 * Package Name:com.jd.orm.framework.core.datasource.impl 
 * Date:2014-5-12下午8:21:44 
 * Copyright (c) 2014, liubing1@jd.com All Rights Reserved. 
 * 
 */

package com.jd.orm.framework.core.datasource;
import javax.sql.DataSource;
import com.jd.orm.framework.configuration.bean.ConfigurationBean;
/**
 * ClassName: ISingerDatasourceFace <br/>
 * Function: singer datasource face. <br/>
 * Reason: TODO ADD REASON. <br/>
 * date: 2014-5-12 下午8:21:44 <br/>
 * 
 * @author liubing1@jd.com
 * @version
 * @since up JDK 1.5
 */

public interface IDatasourceRoute {
	/**
	 * 
	 * getORMDatasource: <br/>
	 * get one datasource from xml configuration<br/>
	 * 
	 * @author liubing1@jd.com
	 * @return
	 * @since JDK 1.5
	 */
	public DataSource getORMDatasource() throws Exception;

	/**
	 * 
	 * getDatasource: <br/>
	 * get one datasource from xml configuration by datasourceId<br/>
	 * 
	 * @author liubing1@jd.com
	 * @param datasourceId
	 * @return
	 * @since JDK 1.5
	 */
	public DataSource getORMDatasource(String datasourceId);

	/**
	 * 
	 * getConfigurationBeanByProperty: <br/>
	 * as the filepath ,get content from peoperty ,instance the
	 * ConfigurationBean .<br/>
	 * @author liubing1@jd.com
	 * @param filepath
	 * @return
	 * @since JDK 1.5
	 */
	public ConfigurationBean getConfigurationBeanByProperty(String filepath);
	/**
	 * 
	 * setDatasource: <br/> 
	 * the method use for setDatasource<br/> 
	 * @author liubing1@jd.com
	 * @param xml 
	 * @since JDK 1.5
	 */
	public void setDatasource(String xml);
	/**
	 * 
	 * setDatasource: <br/> 
	 * the method use for setDatasource<br/> 
	 * @author liubing1@jd.com
	 * @param configurationBean 
	 * @since JDK 1.5
	 */
	public void setDatasource(ConfigurationBean configurationBean);
}
